def input_box(show_str, show_worder, length):
    """

    :param show_str:
    :param show_worder:
    :param length:
    :return:
    """
    instr = input(show_str)
    if len(instr) != 0:
        if show_worder == 1:
            if str.isdigit(instr):
                if instr == 0:
                    print("\033[1;31;40m 输入为零，请重新输入！！！ \033[0m")
                    return "0"
                else:
                    return instr
            else:
                print("\033[1;31;40m 输入非法，请重新输入！！！ \033[0m")
                return "0"
        elif show_worder == 2:
            if str.isalpha(instr):
                if len(instr) != length:
                    print("\033[1;31;40m 必须输入" + str(length) + "个字母，请重新输入！！！ \033[0m")
                    return "0"
                else:
                    return instr
            else:
                print("\033[1;31;40m 输入非法，请重新输入！！！ \033[0m")
                return "0"
        elif show_worder == 3:
            if str.isdigit(instr):
                if len(instr) == length:
                    print("\033[1;31;40m 必须输入" + str(length) + "个数字，请重新输入！！！ \033[0m")
                    return "0"
                else:
                    return instr
            else:
                print("\033[1;31;40m 输入非法，请重新输入！！！ \033[0m")
                return "0"
        else:
            print("\033[1;31;40m 输入非法，请重新输入！！！ \033[0m")
            return "0"
    else:
        print("\033[1;31;40m 输入非法，请重新输入！！！ \033[0m")
        return "0"
